﻿
@{
    ViewBag.Title ="明细表";
    Layout = "~/Views/Shared/_LayoutDateUserCorS.cshtml";
}

@section SubMenu1{ 
            订单:
            <select class="form-control" id="OrderFlag" name="OrderFlag">
                <option selected="selected" value="-1">全部</option>

                @if ((int)ViewData["Flag"] == 0)
                {
                    <option value="0">采购订单</option>
                    <option value="1">采购退货单</option>
                    <option value="2">赠品入库单</option>
                }
                else
                {
                    <option value="0">销售订单</option>
                    <option value="1">销售退货单</option>
                    <option value="2">赠品出库单</option>
                    <option value="3">POS零售单</option>
                    <option value="4">POS退货单</option>
                }
            </select> 
}
 
    <script type="text/javascript">
        $(document).ready(function () {
            $($("#SearchFlag option")[1]).text("按商品筛选");
            $("#SearchFlag").append("<option value='2'>按订单号码筛选</option>");

            $("#UserId").attr("disabled", "disabled");

            var fl = Number(@ViewData["Flag"]);
            if (fl == 2) {//仓库出入库明细表
                $("#CorSId").attr("disabled", "disabled");
                $("#OrderFlag").attr("disabled", "disabled");
                $("#SearchFlag").attr("disabled", "disabled");
                $("#SearchFlag").val(1)
            }

            $(":button").click(function () { 
                $.get("/Jxc/ReportM", {
                        flag: @ViewData["Flag"],
                    startDate: $("#StartDate").val(),
                    endDate: $("#EndDate").val(),
                    corsId: $("#CorSId").val(),
                    searchFlag: $("#SearchFlag").val(),
                    orderFlag: $("#OrderFlag").val()
                },
                    function (data, status) {
                        if (status == "success") { 
                            $("#tableDetail").html(data);
                        }
                        else {
                            alert("远程服务器连接失败");
                        }
                    });
        });
        });
    </script>
 
